/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ecom.servlets;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 * @author Mariam Soumaré
 */
public class Coonteur {

    public static int nbProduct=0;
    public static Map<Long, Integer> numps = new HashMap<Long, Integer>();

    public static Map<Long, Integer> getNumps() {
        return numps;
    }

    public static int getNbProduct() {
        return nbProduct;
    }

    public static void incNbProduct(Long nump, Integer qte) {
        Coonteur.nbProduct ++;
        numps.put(nump, qte);

    }
    public static void decNbProduct(Long nump) {
        if (Coonteur.nbProduct >0){
             numps.remove(nump);
            Coonteur.nbProduct--;}
        else Coonteur.nbProduct=0;

    }
}
